home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
compuserve-file-archive
/
08 System Utilities
/
MIME.BIN
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2019-04-13
|
4KB
|
95 lines
10 POKE55,.:POKE56,27:CLR:Z$=CHR$(.):M$=CHR$(13):Q$=CHR$(34)
20 I$="ENTER DEVICE # OF ":O$="[157] NOT PRESENT":GOSUB900
24 Q=.:PRINT"[147][142]"
25 PRINTI$;"SOURCE DRIVE.":PRINT"(ENTER 0 TO EXIT.)"
35 PRINT" 8[145]":INPUTD:IFD=.THENGOSUB800:END
40 IFD<4ORD>30THENGOSUB700:GOTO25
45 POKE2,36:POKE184,8:POKE185,0:POKE186,D
50 POKE183,1:POKE187,2:POKE188,.:SYS65472
55 CLOSE8:IFPEEK(144)THENPRINT"[147]?DEVICE";D;O$:GOTO25
57 Y=15:OPENY,D,15:GOSUB500:IFA>19THENCLOSEY:GOTO25
60 PRINT"[147]";
65 PRINT"PRESS D FOR DIRECTORY.":PRINT"PRESS S TO START OVER."
75 PRINT"PRESS F TO ENTER SOURCE FILENAME."
80 GETA$:IFA$="D"THENOPEN8,D,0,"$":SYS5288:PRINT"[147]";:GOTO65
85 IFA$="S"THENPRINT"[147]":CLOSEY:GOTO25
90 IFA$="F"THENPRINT"[147]";:GOTO100
95 GOTO80
100 PRINT"ENTER FILENAME.":PRINT"(PRESS RETURN TO START OVER.)"
105 F$="":INPUTF$:IFF$=""THENCLOSEY:GOTO24
110 CLOSE8:Y=15:OPEN8,D,8,F$:GOSUB500:IFA>19THEN100
120 GOSUB600:IFQTHENQ=.:GOTO130
125 PRINT"[147]"
130 PRINTI$;"DESTINATION DRIVE":PRINT"(ENTER 0 TO START OVER.)"
140 PRINT" 8[145]":INPUTE:IFE=.THENGOSUB805:PRINT:GOTO24
145 IFE<4ORE>30THENGOSUB700:GOTO130
150 POKE251,36:POKE252,36:POKE184,9:POKE185,0:POKE186,E
155 POKE183,2:POKE187,251:POKE188,.:SYS65472
160 IFPEEK(144)THENPRINT"[147]?DEVICE";E;O$:CLOSE9:GOTO130
165 Y=16:OPENY,E,15:GOSUB500:IFA>19THENCLOSE9:CLOSEY:Q=1:GOTO110
170 PRINT"[147]0 ";:FORI=1TO6:GET#9,A$:NEXT
180 GET#9,A$:IFA$=""THENPRINT:GOTO190
185 PRINTA$;:GOTO180
190 GET#9,A$:GET#9,A$:GET#9,A$:K=ASC(A$+Z$):GET#9,A$:K=K+256*ASC(A$+Z$)
205 PRINT"[157]";K;
210 GET#9,A$:PRINTA$;:IFSTTHEN220
215 GOTO210
220 CLOSE9:PRINT:PRINT"SOURCE FILENAME: ";F$:PRINT"[157]";N;"BLOCKS"
230 IFINT((12954*N-70)/17780)+1<=KTHEN237
231 PRINT"THERE MAY BE INSUFFICIENT ROOM ON YOUR"
232 PRINT"DISK FOR THE DECODED FILE."
233 PRINT"GO FOR IT? (Y/N)"
234 GETA$:IFA$="Y"THEN237
235 IFA$="N"THENCLOSEY:GOTO110
236 GOTO234
237 PRINT"ENTER DESTINATION FILENAME."
240 PRINT"(ENTER * FOR SAME FILENAME.)"
242 PRINT"(PRESS RETURN TO REENTER DEVICE #.)"
245 G$="":INPUTG$:IFG$=""THENCLOSEY:GOTO110
247 IFG$="*"THENG$=F$
250 OPEN9,E,1,G$:GOSUB500:IFA>19THENCLOSE9:GOTO237
260 PRINT"[147]SOURCE FILENAME: ";F$
265 PRINT"DESTINATION FILENAME: ";G$
270 PRINT"[157]";N;"BLOCKS TO PROCESS":PRINT"STARTING OPERATION..."
280 PRINT" BLOCKS READ BLOCKS WRITTEN"
285 PRINT" [163][163][163][163][163][163][163][163][163][163][163] [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
290 PRINT" 000 000"
400 SYS5507:IFPEEK(782)=255THEN408
402 SYS65484:POKE56334,17
403 PRINT"INVALID FILE; DELETE? (Y/N)"
404 GETA$:IFA$="Y"THEN407
405 IFA$="N"THEN410
406 GOTO404
407 CLOSE9:PRINT#16,"S0:";G$:PRINT"DELETING ";Q$;G$;Q$;"...":GOTO410
408 SYS5655:IFPEEK(2)THEN403
409 PRINT"...DONE. FILE DECODED."
410 GOSUB800:PRINT"PRESS RETURN."
415 GETA$:IFA$=M$THEN24
420 GOTO415
500 INPUT#Y,A,B$,C,Z:IFA<20THENRETURN
510 PRINT:PRINTA:PRINT:PRINTB$:PRINT:PRINTC,Z:PRINT:RETURN
600 PRINT#15,"M-R";CHR$(144);CHR$(2);CHR$(5)
605 GET#15,A$:S=ASC(A$+Z$):GET#15,A$:GET#15,A$:GET#15,A$
615 GET#15,A$:P=ASC(A$+Z$):OPEN5,D,5,"#":PRINT#15,"U1";5;.;18;S
630 PRINT#15,"B-P";5;P+28:GET#5,A$:N=ASC(A$+Z$):GET#5,A$:N=N+256*ASC(A$+Z$)
645 PRINT#15,"B-P";5;P+3:I=.:F$=""
655 GET#5,A$
660 IFI=16ORA$="[160]"THENCLOSE5:RETURN
665 F$=F$+A$:I=I+1:GOTO655
700 PRINT"[147]ILLEGAL DEVICE NUMBER":RETURN
800 POKE56,160
805 CLOSE15:CLOSE16:CLOSE8:CLOSE9:RETURN
900 PRINT"[147] [212]HIS FILE IS FOR THE [195]OMMODORE-64."
905 PRINT"[212]HE PROGRAM WILL DECODE A 7-BIT MESSAGE"
910 PRINT"CONTAINING BINARY DATA ENCODED USING"
915 PRINT"THE ";Q$;"[205][201][205][197]/[194]ASE64";Q$;" METHOD. [198]REQUENTLY,"
920 PRINT"THE MESSAGE WILL CONTAIN A TEXT HEADER"
925 PRINT"AND FOOTER; THEY WILL BE IGNORED BY THIS"
930 PRINT"PROGRAM (THE FOOTER WILL NOT BE READ)."
935 PRINT"[212]HE DECODED FILE WILL BE A [208][210][199] TYPE;"
940 PRINT"EITHER ONE OR TWO DISK DRIVES (1541"
945 PRINT"AND/OR 1571) MAY BE USED."
997 PRINT" [[208][210][197][211][211] [210][197][212][213][210][206]][146]";
998 GETA$:IFA$=M$THENRETURN
999 GOTO998